var windowName = "userMoneyLog";
var Page,logYue,logXuni,logGuquan
apiready = function(){
    onWindowShow(function () {
    })
    onWindowHide(function () {
    })
    console.log("index page is OK");
    logYue = new List();
    logXuni = new List();
    logGuquan = new List();
    Page = createVM("#Page",{
        //页面数据
        money:{"yue":0,"bao":0,"jifen":0,"xuni":0,"exp":0}
        ,total:"数据获取中……"
        ,curTab:0
        ,logYue:[]
        ,logXuni:[]
        ,logGuquan:[]
    },{
        //页面方法
        "init":function () {
            logYue.setUrl("/app/user/money/log").setData({type:"yue"}).setCbFunc(function (res) {
                clearLoading();
                logJson(res,"logYue")
                Page.logYue = res
            }).getList();
            logXuni.setUrl("/app/user/money/log").setData({type:"xuni"}).setCbFunc(function (res) {
                clearLoading();
                logJson(res,"logYue")
                Page.logXuni = res
            }).getList();
            logGuquan.setUrl("/app/user/money/log").setData({type:"guquan"}).setCbFunc(function (res) {
                clearLoading();
                logJson(res,"logYue")
                Page.logGuquan = res
            }).getList();
        }
        ,tab:function (index) {
            log(index,"index")
        }
    })
    Page.init()

    onPullUpLoadMore(function () {
        if (Page.curTab == 0) {logYue.getList();}
        if (Page.curTab == 1) {logXuni.getList();}
        if (Page.curTab == 2) {logGuquan.getList();}
    })
}
